const {app,assert} = require('egg-mock/bootstrap');
/**
 * 如何测试ctx
 * context 上下文环境
 */
describe('test\controller\news.js',function(){
    it('context',()=>{
        const ctx = app.mockContext({
            session:{user:{username:'zhufeng'}}
        });
        assert(ctx.method === 'GET');
        assert(ctx.url == '/');
        assert(ctx.session.user.username == 'zhufeng');
    });
});